home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / graphics / switchf.arc / aline.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-08-24  |  26.0 KB  |  562 lines

  1.  
  2.         /***********************************************\
  3.         *                        *
  4.         *                aline.h            *
  5.         *    Common include file for C interface    *
  6.         *    to low level Line A calls        *
  7.         *                        *
  8.         *    J.R. Bammi                *
  9.         *      decvax!cwruecmp!bammi            *
  10.         *      bammi%cwru.edu.CSNET            *
  11.         *      bammi@cwru.edu.ARPA            *
  12.         *      CIS: 71515,155            *
  13.         *                        *
  14.         \***********************************************/
  15.  
  16. #include "compiler.h"        /* Compiler dependent defines    */
  17.  
  18.  
  19. /*****************************************************************************\
  20. *                                                                      *
  21. *                                 Defines                                     *
  22. *                                          *
  23. \*****************************************************************************/
  24.  
  25. /*
  26.  *  Object colors (default pallette)
  27.  *
  28.  */
  29. #define WHITE    0
  30. #define BLACK    1
  31. #define RED      2
  32. #define GREEN    3
  33. #define BLUE     4
  34. #define CYAN     5
  35. #define YELLOW   6
  36. #define MAGENTA  7
  37. #define LWHITE   8
  38. #define LBLACK   9
  39. #define LRED     10
  40. #define LGREEN   11
  41. #define LBLUE    12
  42. #define LCYAN    13
  43. #define LYELLOW  14
  44. #define LMAGENTA 15
  45.  
  46.  
  47. /* 
  48.  * Vdi writing modes
  49.  *
  50.  */
  51. #define MD_REPLACE 1
  52. #define MD_TRANS   2
  53. #define MD_XOR     3
  54. #define MD_ERASE   4
  55.  
  56.  
  57. /*
  58.  * Raster Op Codes
  59.  *
  60.  */
  61. #define ALL_WHITE  0
  62. #define S_AND_D    1
  63. #define    S_AND_NOTD 2
  64. #define S_ONLY     3
  65. #define NOTS_AND_D 4
  66. #define    D_ONLY     5
  67. #define S_XOR_D    6
  68. #define S_OR_D     7
  69. #define    NOT_SORD   8
  70. #define    NOT_SXORD  9
  71. #define D_INVERT  10
  72. #define    NOT_D     11
  73. #define    S_OR_NOTD 12
  74. #define NOTS_OR_D 13
  75. #define    NOT_SANDD 14
  76. #define ALL_BLACK 15
  77.  
  78. /*
  79.  * Sprite formats
  80.  *
  81.  */
  82. #define SP_VDI        0
  83. #define SP_XOR        1
  84.  
  85. /*
  86.  * Line A Opcodes
  87.  *
  88.  */
  89. #define    INIT        0
  90. #define PUTPIXEL    1
  91. #define GETPIXEL    2
  92. #define LINE        3
  93. #define HLINE        4
  94. #define RECTANGLE    5
  95. #define FPOLYGON    6
  96. #define BITBLT        7
  97. #define TEXTBLT        8
  98. #define SHOWMOUSE    9
  99. #define HIDEMOUSE    10
  100. #define TRANMOUSE    11
  101. #define USPRITE        12
  102. #define DSPRITE        13
  103. #define CPYRASTER    14
  104. #define FSEEDFILL    15    /* ROM TOS only    */
  105.  
  106.  
  107. /*****************************************************************************\
  108. *                                                                      *
  109. *                                 Types                                       *
  110. *                                          *
  111. \*****************************************************************************/
  112.  
  113.     /*
  114.      * Global Variables at negative offsets from the Line A parameter
  115.      * block address returned by init. (I have no way of telling if this
  116.      * list is complete).
  117.      *
  118.      */
  119. /* Name   Offset  Type    Description                         */
  120. /* --------------------------------------------------------------------------*/
  121. /* V_Y_MAX    -4   W    Max Y pixel value of the screen                 */
  122. /* V_STATUS   -6   W    Text Status byte                     */
  123. /*               Bit    Field        Zero        One         */
  124. /*              0    cursor flash    disabled    enabled         */
  125. /*              1    flash state     off        on         */
  126. /*              2    cursor visible  no        yes          */
  127. /*              3     end of line     no-wrap        wrap         */
  128. /*              4     inverse video   on              off          */
  129. /*                        5     cursor saved    false           true         */
  130. /* V_OFF_AD  -10   L    Font offset table address                 */
  131. /* V_X_MAX   -12   W    Max X pixel value                     */
  132. /* V_FNT_WR  -14   W    Width of Font Form in bytes (see type FONT below)    */
  133. /* V_FNT_ST  -16   W    First font ASCII code (first_ade)             */
  134. /* V_FNT_ND  -18   W    Last  font ASCII code (last_ade )                    */
  135. /* V_FNT_AD  -22   L    Font Form address                     */
  136. /*            Mono Spaced, 8 pixels wide and byte aligned, any ht. */
  137. /* V_CUR_TIM -23   B    Cursor countdown timer                     */
  138. /* V_CUR_CNT -24   B    Cursor flash interval( in frames)             */
  139. /* V_CUR_CY  -26   W    Y cursor position                     */
  140. /* V_CUR_CX  -28   W    X cursor position                     */
  141. /* V_CUR_OFF -30   W    Offset from screen base to first cell (bytes)         */
  142. /* V_CUR_AD  -34   L    Current cursor address                     */
  143. /* V_COL_FG  -36   W    Foreground color index                     */
  144. /* V_COL_BG  -38   W    Background color index                     */
  145. /* V_CEL_WR  -40   W    Offset to next vertical cell (bytes)             */
  146. /* V_CEL_MY  -42   W    Max cells high - 1                     */
  147. /* V_CEL_MX  -44   W    Max cells across - 1                     */
  148. /* V_CEL_HT  -46   W    Cell height in pixels (font form's height)         */
  149. /* --------------------------------------------------------------------------*/
  150.  
  151. /*
  152.  * Atari finally named these variables
  153.  * so here they are
  154.  *
  155.  */
  156. typedef struct {
  157.     WORD    V_CEL_HT;    /* *((WORD  *)((char  *)aline - (char  *)46L)) */
  158.     WORD    V_CEL_MX;    /* *((WORD  *)((char  *)aline - (char  *)44L)) */
  159.     WORD    V_CEL_MY;    /* *((WORD  *)((char  *)aline - (char  *)42L)) */
  160.     WORD    V_CEL_WR;    /* *((WORD  *)((char  *)aline - (char  *)40L)) */
  161.     WORD    V_COL_BG;    /* *((WORD  *)((char  *)aline - (char  *)38L)) */
  162.     WORD    V_COL_FG;    /* *((WORD  *)((char  *)aline - (char  *)36L)) */
  163.     char    *V_CUR_AD;   /* *((char **)((char **)aline - (char **)34L)) */
  164.     WORD    V_CUR_OFF;   /* *((WORD  *)((char  *)aline - (char  *)30L)) */
  165.     WORD    V_CUR_CX;    /* *((WORD  *)((char  *)aline - (char  *)28L)) */
  166.     WORD    V_CUR_CY;    /* *((WORD  *)((char  *)aline - (char  *)26L)) */
  167.     WORD    V_CUR_CNT;   /* *((char  *)((char  *)aline - (char  *)24L)) */
  168. /*    char    V_CUR_TIM;    *((char  *)((char  *)aline - (char  *)23L))   */
  169.     char    **V_FNT_AD;  /* *((char **)((char **)aline - (char **)22L)) */
  170.     WORD    V_FNT_ND;    /* *((WORD  *)((char  *)aline - (char  *)18L)) */
  171.     WORD    V_FNT_ST;    /* *((WORD  *)((char  *)aline - (char  *)16L)) */
  172.     WORD    V_FNT_WR;    /* *((WORD  *)((char  *)aline - (char  *)14L)) */
  173.     WORD    V_X_MAX;     /* *((WORD  *)((char  *)aline - (char  *)12L)) */
  174.     char    **V_OFF_AD;  /* *((char **)((char **)aline - (char **)10L)) */
  175.     WORD    V_STATUS;    /* *((WORD  *)((char  *)aline - (char  *) 6L)) */
  176.     WORD    V_Y_MAX;     /* *((WORD  *)((char  *)aline - (char  *) 4L)) */
  177.     WORD    xxdummy;     /* *((WORD  *)((char  *)aline - (char  *) 2L)) */
  178. } NLINEA;
  179.  
  180.  
  181.     /* A pointer to the type LINEA is returned by the Line A init call
  182.      * ($A000), in registers A0 and D0.
  183.          * This pointer is saved in the global variable 'aline'.
  184.      *
  185.      */
  186. typedef struct {
  187.  
  188. /* Type    Name       Offset   Function            Comments             */
  189. /* ------------------------------------------------------------------------- */
  190.    WORD   VPLANES;    /*  0  # of Planes     Also see CurrRez            */
  191.    WORD      VWRAP;      /*  2  Bytes / scan line    "    "    "                */
  192.               /*     VWRAP can be changed to implement special effect*/
  193.               /*     Doubling VWRAP will skip every other scan line  */
  194.               /*                                 */
  195.               /*                                                     */
  196.    WORD      *CONTRL;    /*  4  Ptr to CONTRL Array  Contrl gets set to this    */
  197.    WORD      *INTIN;     /*  8  Ptr to INTIN  Array  Intin  gets set to this    */
  198.    WORD      *PTSIN;     /* 12  Ptr to PTSIN  Array  Ptsin  gets set to this    */
  199.    WORD   *INTOUT;    /* 16  Ptr to INTOUT Array  Intout gets set to this    */
  200.    WORD   *PTSOUT;    /* 20  Ptr to PTSOUT Array  Ptsout gets set to this    */
  201.               /*     CONTRL is the control array             */
  202.               /*     INTIN is the array of input parameters         */
  203.               /*     PTSIN is the array of input coordinates         */
  204.               /*      Even entrys are X coordinate             */
  205.               /*       Odd  entrys are corresponding Y coodinates */
  206.               /*     INTOUT is the array of output parameters        */
  207.               /*     PTSOUT is the array of output coordinates       */
  208.               /*    organizes like PTSIN.                 */
  209.               /*                                 */
  210.    WORD   COLBIT0;    /* 24  Plane 0 Color Value  All Three Rez's         */
  211.    WORD   COLBIT1;    /* 26  Plane 1 Color Value  Med and Low Rez only         */
  212.    WORD      COLBIT2;    /* 28  Plane 2 Color Value  Low Rez only              */
  213.    WORD   COLBIT3;    /* 30  Plane 3 Color Value  Low Rez Only              */
  214.               /*     Foreground color COLBIT0 + 2*COLBIT1 + 4*COLBIT2*/
  215.               /*                  + 8*COLBIT3             */
  216.               /*                                 */
  217.               /*                                                     */
  218.    WORD      LSTLIN;     /* 32  Always set to -1, Done for you in init_aline()  */
  219.               /*     Does anyone know what it is supposed to be?     */
  220.               /*                                 */
  221.    WORD   LNMASK;     /* 34  Linemask used when drawing lines, same as Vdi's */
  222.               /*     line style                                      */
  223.               /*                                 */
  224.    WORD      WMODE;      /* 36  Writing mode                                    */
  225.               /*     0=Replace Mode-Replace all bits in Dest with src*/
  226.               /*     1=Trans. Mode-Only additional bits in src set(OR*/
  227.               /*     2=Xor Mode- Src XOR Dest                 */
  228.               /*     3=Inverse Trans.- (NOT src) Or Dest             */
  229.               /*     Values upto 16 are permitted                    */
  230.               /*                                 */
  231.    WORD   X1;          /* 38  X1 coordinate used in various calls             */
  232.               /*                                 */
  233.    WORD   Y1;         /* 40  Y1 coordinate used in various calls             */
  234.               /*                                 */
  235.    WORD   X2;         /* 42  X2 coordinate used in various calls             */
  236.               /*                                 */
  237.    WORD   Y2;         /* 44  Y2 coordinate used in various calls             */
  238.               /*                                 */
  239.               /*                                                     */
  240.    WORD   *PATPTR;    /* 46  Pointer to current fill pattern                 */
  241.                       /*     Must be integral power of 2 (words) in length   */
  242.    WORD   PATMSK;     /* 50  I don't know why they call it a mask. It is in  */
  243.               /*     reality the length in words of the current patt.*/
  244.    WORD   MFILL;      /* 52  Multi Plane fill flag 1 == Current fill Pattern */
  245.               /*     is for Muti Plane.                              */
  246.               /*                                                     */
  247.               /*                                                     */
  248.    WORD   CLIP;       /* 54  Clipping Flag 1 == TRUE                         */
  249.    WORD   XMINCL;     /* 56  Min X of clipping window                 */
  250.    WORD   YMINCL;     /* 58  Min Y of clipping window                        */
  251.    WORD   XMAXCL;     /* 60  Max X of clipping window                 */
  252.    WORD   YMAXCL;     /* 62  Max Y of clipping window                        */
  253.               /*                                                     */
  254.               /*                                                     */
  255.    WORD   XDDA;       /* 64  Accumulator for Scaling, Must be set to 0x08000 */
  256.                       /*     before each call to Text Blt. Done for you in   */
  257.               /*     in aline_text()                                 */
  258.    WORD   DDAINC;     /* 66  Scaling factor - Fractional amount to scale char*/
  259.               /*     When scaling up = 256 *(Size-Textsize)/Textsize */
  260.               /*     When scaling down = 256*(Size)/Textsize         */
  261.               /*     scaling down does not work                      */
  262.    WORD   SCALDIR;    /* 68  Scaling direction 0 == down                     */
  263.    WORD   MONO;       /* 70  Mono flag 0== current font is a propotional font*/
  264.               /*     Its Ok for Thickening to increase the width of  */
  265.               /*     the current character.                          */
  266.               /*     1 == current font is mono spaced, so thickening */
  267.               /*     may not increase the width of the current char  */
  268.               /*                                                     */
  269.    WORD   SOURCEX;    /* 72  X coordinate of character in the font form      */
  270.               /*     SOURCEX is caluclated from info in the font     */
  271.               /*     header for the current font (see FONT type)     */
  272.               /*     SOURCEX = off_table[char-first_ade]         */
  273.               /*     SOURCEX is calculated for you in aline_text()   */
  274.               /*     The pointer to a table of font header for the   */
  275.               /*     internal fonts is returned in A2 on init (A000) */
  276.    WORD   SOURCEY;    /* 74  Y coodinate of character in the font form       */
  277.               /*     Typically set to 0 (top line of font form)         */
  278.    WORD   DESTX;      /* 76  X coordinate of character on screen             */
  279.    WORD   DESTY;      /* 78  Y coordinate of character on screen             */
  280.    WORD   DELX;       /* 80  Width of Character                     */
  281.               /*     Difference between two SOURCEX's                 */
  282.    WORD   DELY;       /* 82  Height of Character                             */
  283.               /*     form_height field of FONT_HEAD of current font  */
  284.    WORD   *FBASE;     /* 84  Pointer to start of font form                   */
  285.    WORD   FWIDTH;     /* 88  Width of the current font's form                */
  286.               /*                                                     */
  287.    WORD   STYLE;      /* 90  Vector of style flags                 */
  288.               /*     Bit 0 = Thicken Flag                 */
  289.               /*     Bit 1 = Lighten Flag                 */
  290.               /*     Bit 2 = Skewing Flag                 */
  291.               /*     Bit 3 = Underline Flag (ignored)             */
  292.               /*     Bit 4 = Outline Flag                 */
  293.               /*                                                     */
  294.    WORD   LITEMASK;   /* 92  Mask used for lightening text               */
  295.               /*     The Mask is picked up from the font header      */
  296.    WORD   SKEWMASK;   /* 94  Mask used for skewing text                 */
  297.               /*     The Mask is picked up from the font header      */
  298.    WORD   WEIGHT;     /* 96  The number of bits by which to thicken text     */
  299.               /*     The number is picked up from the font header    */
  300.    WORD   ROFF;       /* 98  Offset above baseline when skewing              */
  301.                       /*     Again picked up from the font header            */
  302.               /*                             */
  303.    WORD   LOFF;       /* 100 Offset below character baseline when skewing    */
  304.                       /*     Again picked up from the font header            */
  305.               /*                                                     */
  306.    WORD   SCALE;      /* 102 Scaling Flag 1 == true                          */
  307.               /*                                                     */
  308.    WORD   CHUP;          /* 104 Character rotation vector.                      */
  309.                  /*     0 = normal (0 degrees)                 */
  310.               /*     1800 = 180 degrees                     */
  311.                     /*     2700 = 270 degrees                              */
  312.               /*                                                     */
  313.    WORD   TEXTFG;     /* 106 Text foreground color                 */
  314.               /*                                                     */
  315.    char   *SCRTCHP;   /* 108 Address of buffer required for creating special */
  316.               /*     text effects. The size of this buffer should be */
  317.               /*     1K according the Internals. The Atari document  */
  318.               /*     of course does not talk about such things :-)   */
  319.                       /*                                                     */
  320.    WORD   SCRPT2;     /* 112 The offset of the scaling buffer buffer in above*/
  321.                       /*     buffer. Internals suggests an offset of 0x0040  */
  322.                       /*     As usual the Atari document does'nt say a thing */
  323.                       /*                                                     */
  324.    WORD   TEXTBG;     /* 114 Text background color (Ram Vdi only)            */
  325.                       /*     used for the BitBlt writing modes (4-19) only   */
  326.                       /*                                                     */
  327.    WORD   COPYTRAN;   /* 116 Copy raster form type flag (Ram vdi only)       */
  328.                       /*     0 => Opaque type                                */
  329.                       /*          n-plane source  ->  n-plane dest           */
  330.                       /*              BitBlt writing modes (4-19)            */
  331.                       /*    ~0 => Transparent type                           */
  332.                       /*          1-plane source  ->  n-plane dest           */
  333.                       /*              Vdi writing modes (1-3)                */
  334.                       /*                                                     */
  335.    WORD(*SEEDABORT)();/* 118 Pointer to function returning int, which is     */
  336.                       /*     called by the fill logic to allow the fill to   */
  337.                       /*     be aborted. If the routine returns FALSE (0)    */
  338.                       /*     the fill is not aborted. If it returns TRUE (~0)*/
  339.                       /*     the fill is aborted                             */
  340. /* ------------------------------------------------------------------------- */
  341.  
  342. } LINEA;             /*       P H E W !!!!!                                  */
  343.  
  344.  
  345.  
  346.     /* A pointer to array of type FONT is returned by the Line A init call
  347.      * ($A000), in regsister A1.
  348.          * This pointer is saved in the global array variable 'fonts[]'.
  349.      *
  350.      */
  351.  
  352. typedef struct _font {
  353.  
  354. /* Type    Name       Offset   Function            Comments             */
  355. /* ------------------------------------------------------------------------- */
  356.    WORD   font_id;    /*  0 Font face identifier  1 == system font           */
  357.                       /*                                                     */
  358.    WORD   size;       /*  2 Font size in points                              */
  359.                       /*                                                     */
  360.    char   name[32];   /*  4 Face name                                        */
  361.                       /*                                                     */
  362.    WORD   first_ade;  /* 36 Lowest ADE value in the face (lowest ASCII value */
  363.                       /*    of displayable character).                       */
  364.                       /*                                                     */
  365.    WORD   last_ade;   /* 38 Highest ADE value in the face (highest ASCII valu*/
  366.                       /*    of displayable character).                       */
  367.                       /*                                                     */
  368.    WORD   top;        /* 40 Distance of top line relative to baseline        */
  369.                       /*                                                     */
  370.    WORD   ascent;     /* 42 Distance of ascent line relative to baseline     */
  371.                       /*                                                     */
  372.    WORD   half;       /* 44 Distance of half line relative to baseline       */
  373.                       /*                                                     */
  374.    WORD   descent;    /* 46 Distance of decent line relative to baseline     */
  375.                       /*                                                     */
  376.    WORD   bottom;     /* 48 Distance of bottom line relative to baseline     */
  377.                       /*    All distances are measured in absolute values    */
  378.                       /*    rather than as offsets. They are always +ve      */
  379.                       /*                                                     */
  380.  WORD max_char_width; /* 50 Width of the widest character in font            */
  381.                       /*                                                     */
  382.  WORD max_cell_width; /* 52 Width of the widest cell character cell in face  */
  383.                       /*                                                     */
  384.    WORD left_offset;  /* 54 Left Offset see Vdi appendix G                   */
  385.                       /*                                                     */
  386.    WORD right_offset; /* 56 Right offset   "      "     "                    */
  387.                       /*                                                     */
  388.    WORD   thicken;    /* 58 Number of pixels by which to thicken characters  */
  389.                       /*                                                     */
  390.    WORD   ul_size;    /* 60 Width in  pixels of the underline                */
  391.                       /*                                                     */
  392.    WORD   lighten;    /* 62 The mask used to lighten characters              */
  393.                       /*                                                     */
  394.    WORD   skew;       /* 64 The mask used to determine when to perform       */
  395.                       /*    additional rotation on the character to perform  */
  396.                       /*    skewing                                          */
  397.                       /*                                                     */
  398.    WORD   flags;      /* 66 Flags                                            */
  399.                       /*      bit 0 set if default system font               */
  400.                       /*      bit 1 set if horiz offset table should be used */
  401.                       /*      bit 2 byte-swap flag (thanks to Intel idiots)  */
  402.                       /*      bit 3 set if mono spaced font                  */
  403.                       /*                                                     */
  404.    char   *h_table;   /* 68 Pointer to horizontal offset table               */
  405.                       /*                                                     */
  406.    WORD   *off_table; /* 72 Pointer to character offset table                */
  407.                       /*                                                     */
  408.    char   *dat_table; /* 76 Pointer to font data                             */
  409.                       /*                                                     */
  410.    WORD   form_width; /* 80 Form width (#of bytes /scanline in font data)    */
  411.                       /*                                                     */
  412.    WORD   form_height;/* 82 Form height (#of scanlines in font data)         */
  413.                       /*                                                     */
  414.  struct _font *next_font;  /* 84 Pointer to next font in face                */
  415.                       /*                                                     */
  416. /* ------------------------------------------------------------------------- */
  417. } FONT;
  418.  
  419.     
  420.     /*
  421.      * OP_TAB type required for Bit Blt parameter block.
  422.      * each entry defines the logic operation to apply for
  423.      * the 4 Fore/Back ground bit combinations
  424.      */
  425. typedef struct {
  426.  
  427. /* Type    Name       Offset   Function            Comments             */
  428. /* ------------------------------------------------------------------------- */
  429.    char   fg0bg0;     /* 0    Logic op to employ when both FG and BG are 0 */
  430.    char   fg0bg1;     /* 1    Logic op to employ when FG = 0 and BG = 1    */
  431.    char   fg1bg0;     /* 2    Logic op to employ when FG = 1 and BG = 0    */
  432.    char   fg1bg1;     /* 3    Logic op to employ when both FG and BG are 1 */
  433. /* ------------------------------------------------------------------------- */
  434. } OP_TAB;
  435.  
  436.  
  437. /*
  438.  * Source and destination description blocks
  439.  */
  440. typedef struct  {
  441.     WORD    bl_xmin;        /* Minimum x            */
  442.     WORD    bl_ymin;        /* Minimum y             */
  443.     char    *bl_form;        /* Word aligned memory form     */
  444.     WORD    bl_nxwd;        /* Offset to next word in line  */
  445.     WORD     bl_nxln;        /* Offset to next line in plane */
  446.     WORD     bl_nxpl;        /* Offset to next plane     */
  447. }SDDB;
  448.  
  449.     /* Offsets to next word in plane */
  450. #define HI_NXWD        2
  451. #define MED_NXWD    4
  452. #define LOW_NXWD    8
  453.  
  454.     /* Scan line widths of the screen */
  455. #define HI_NXLN        80
  456. #define MED_NXLN    160
  457. #define LOW_NXLN    160
  458.  
  459.     /*
  460.      * Offsets between planes - always the same due to
  461.      * the way the STs video memory is laid out
  462.          */
  463. #define NXPL        2
  464.  
  465.     /* 
  466.      * Bit Blt Parameter Block Type (for function $A007)
  467.      *
  468.      */
  469.  
  470. typedef struct {
  471.  
  472. /* Type    Name           Offset   Function            Comments         */
  473. /* ------------------------------------------------------------------------- */
  474.    WORD       bb_b_wd;     /*     width of block in pixels              */
  475.    WORD       bb_b_ht;     /*     height of block in pixels             */
  476.    WORD       bb_plane_ct; /*     number of planes to blit              */
  477.    WORD       bb_fg_col;   /*     foreground color                  */
  478.    WORD       bb_bg_col;   /*     back    ground color                  */
  479.    OP_TAB  bb_op_tab;   /*     logic for fg x bg combination              */
  480.    SDDB       bb_s;        /*     source info block                 */
  481.    SDDB       bb_d;        /*     destination info block              */
  482.    WORD       *bb_p_addr;  /*     pattern buffer address              */
  483.    WORD       bb_p_nxln;   /*     offset to next line in pattern          */
  484.    WORD       bb_p_nxpl;   /*     offset to next plane in pattern          */
  485.    WORD       bb_p_mask;   /*     pattern index mask                  */
  486.    char       bb_fill[24];    /*     work space                     */
  487. /* ------------------------------------------------------------------------- */
  488. } BBPB;
  489.  
  490.  
  491. /*
  492.  * Memory Form Definition Block
  493.  *
  494.  */
  495. typedef struct
  496. {
  497.     char        *fd_addr;    /* Addrerss of upper left corner of firs*/
  498.                                      /* plane of raster area. If NULL then   */
  499.                                      /* MFDB is for a physical device        */
  500.     WORD        fd_w;         /* Form Width in Pixels                 */
  501.     WORD        fd_h;        /* Form Height in Pixels                */
  502.     WORD        fd_wdwidth;  /* Form Width in words (fd_w/sizeof(int)*/
  503.     WORD        fd_stand;    /* Form format 0= device spec 1=standard*/
  504.     WORD        fd_nplanes;  /* Number of memory planes              */
  505.     WORD        fd_r1;       /* Reserved                             */
  506.     WORD        fd_r2;       /* Reserved                             */
  507.     WORD        fd_r3;       /* Reserved                             */
  508. } MFDB;
  509.  
  510.  
  511.  
  512.  
  513. /*
  514.  * Sprite definition block
  515.  *
  516.  */
  517. typedef struct
  518. {
  519.     WORD    sp_xhot;        /* Offset to X hot spot        */
  520.     WORD    sp_yhot;        /* Offset to Y hot spot        */
  521.     WORD    sp_format;        /* Format SP_VDI or SP_XOR     */
  522.     WORD    sp_bg;            /* Background color        */
  523.     WORD    sp_fg;            /* Foregroud color        */
  524.     WORD    sp_data[32];        /* Sprite data -         */
  525.                     /* Alternating words of back/fore */
  526.                     /* ground data              */
  527.                     /* Note that:              */
  528.                     /*   sprite save block is         */
  529.                     /*  10+VPLANES*64 bytes long      */
  530.  
  531. } SFORM;
  532.  
  533.  
  534.  
  535. /*****************************************************************************\
  536. *                                                                      *
  537. *                             Global Variables                      *
  538. *                                                                      *
  539. \*****************************************************************************/
  540.  
  541.     /*
  542.      * Global Variables are defined in alglobal.c, extern every where else
  543.      *
  544.      */
  545. #ifndef ALGLOBAL
  546.  
  547.     /* global vars */
  548. extern LINEA *aline;    /* Pointer to line a parameter block returned by init*/
  549.  
  550. extern NLINEA *naline;  /* Pointer to line a parameters at negative offsets  */
  551.  
  552. extern FONT  **fonts;    /* Array of pointers to the three system font headers*/
  553.             /* returned by init (in register A1)             */
  554.  
  555. extern WORD  (**funcs)();  /* Array of pointers to the 15 line a functions   */
  556.                /* returned by init (in register A2)             */
  557.                /* only valid in ROM'ed TOS                 */
  558.  
  559.     /* Functions */
  560. extern VOID init_aline();
  561. #endif /* ALGLOBAL */
  562.